package cn.zwx.member.svc.domain.enums;

/**
 * @author zhangwenxue
 */

public enum UserLevelEnum {

    /**
     * 青铜会员
     */
    LEVEL_1(1,"青铜会员"),
    /**
     * 青铜会员
     */
    LEVEL_2(2,"白银会员"),
    /**
     * 青铜会员
     */
    LEVEL_3(3,"黄金会员"),
    /**
     * 青铜会员
     */
    LEVEL_4(4,"铂金会员"),
    /**
     * 青铜会员
     */
    LEVEL_5(5,"钻石会员"),
    /**
     * 青铜会员
     */
    LEVEL_6(6,"黑钻会员"),
    ;
    private final int code;
    private final String msg;
    UserLevelEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static String ofValue(int code){
        final UserLevelEnum[] values = values();
        for (UserLevelEnum value : values) {
            if (value.code == code){
                return value.msg;
            }
        }
        return "-";
    }
}
